package example.stream;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * table api
 *
 * flink sql
 */
public class TableApiExample {
    public static void main(String[] args) {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();


        DataStreamSource<String> source = env.socketTextStream("47.95.141.170", 7777);

        SingleOutputStreamOperator<People> map = source.map(a -> {
            String[] split = a.split(",");
            return new People(split[0], Integer.parseInt(split[1]), Long.parseLong(split[2]), Integer.parseInt(split[3]));
        });



    }
}
